﻿using GameStructure.Contracts;
using GameStructure.Core;
using GameStructure.Types;
using GameStructure.Utilities;
using Tao.OpenGl;

namespace GameStructure.GaneState
{
    public class TextRenderState : IGameObject
    {
        private readonly Text _helloWorld;
        private readonly Renderer _renderer = new Renderer();

        public TextRenderState(TextureManager textureManager)
        {
            var font = new Font(textureManager.Get("font"), FontParser.Parse(@"Resources\font.fnt"));
            _helloWorld = new Text("Hello", font);
        }

        public void Update(double elapsedTime)
        {
            
        }

        public void Render()
        {
            Gl.glClearColor(0.0f,0.0f,0.0f,1.0f);
            Gl.glClear(Gl.GL_COLOR_BUFFER_BIT);
            _renderer.DrawText(_helloWorld);
        }
    }
}
